// *********************************************************
// Setup contains the loading of major files and setup of game enviroment. 
// also creates all the objects and units for the game. 
// *********************************************************


	//dbMaximizeWindow ();

	//load all the sounds
	dbLoadSound("Ding2.wav",1001);
	dbLoadSound("Press2.wav",1000);
	
	player=gold;
	#include "oldMenu.h"  // code that has been commented out

	dbChangeMouse(1);
	dbColorBackdrop(0);
	
	//load gun sounds
	dbLoadSound("Gun 2.wav",3);
	dbLoadSound("Cannon.wav",4);
	dbLoadSound("Boom 2.wav",9);
	dbLoadSound("Jet Flyby 2.wav",1002);

	dbLoadSound("subm1.wav",200);
	dbLoadSound("subm2.wav",201);
	dbLoadSound("subm3.wav",202);
	dbLoadSound("subm4.wav",203);

	////Adam's City_______________________________
	//dbLoadImage(
	//"building1.bmp", 30005);

	//dbLoadImage(
	//"building1roof.bmp", 30007);

	//dbLoadImage(
	//"building2.bmp", 30008);

	//dbLoadImage(
	//"building2roof.bmp", 30009);

	//dbLoadImage(
	//"building300.bmp", 30010);

	//dbLoadImage(
	//"building300roof.bmp", 30011);

	//dbLoadImage(
	//"building4.bmp", 30012);

	//dbLoadImage(
	//"building4roof.bmp", 30013);

	//int builTex[6];

	//builTex[0] = 30005;

	//builTex[1] = 30005;

	//builTex[2] = 30008;

	//builTex[3] = 30010;

	//builTex[4] = 30012;

	//builTex[5] = 30012;

	//int roofTex[6];

	//roofTex[0] = 30007;

	//roofTex[1] = 30007;

	//roofTex[2] = 30009;

	//roofTex[3] = 30011;

	//roofTex[4] = 30013;

	//roofTex[5] = 30013;

	//Make the Ground


	//===============================
	//Will use object ids from 30020 to 30040 for buildings and their roofs
	//=====================

	//////////////////////////////////////////////
	//////////////////////////////////////////////
	//////////////////////////////////////////////
	//////////////////////////////////////////////

	//BuildingN building;
	//for (int xx=30020; xx< 30079; xx++)
	//building.NewBuilding(xx, xx+80, (rand() % 70) , rand()%(400) , rand() %(400), builTex[(rand()%4) +1], roofTex[(rand() % 4 + 1)]);
	//
	//building.NewBuilding(30022, 30023, (rand() % 70) , -rand()%(400) , rand() %(400), builTex[(rand()%4 )+1], roofTex[(rand() % 4 + 1)]);
	//
	//building.NewBuilding(30024, 30025, (rand() % 70) , rand()%(400) , -rand() %(400), builTex[(rand()%4 )+1], roofTex[(rand() % 4 + 1)]);

	//building.NewBuilding(30026, 30027, (rand() % 70) , -rand()%(400) , -rand() %(400), builTex[(rand()%4) +1], roofTex[(rand() % 4 + 1)]);

	//building.NewBuilding(30028, 30029, (rand() % 70) , rand()%(400) , -rand() %(400), builTex[(rand()%4 )+1], roofTex[(rand() % 4 + 1)]);

	//building.NewBuilding(30030, 30031, (rand() % 70) , -rand()%(400) , rand() %(400), builTex[(rand()%4) +1], roofTex[(rand() % 4 + 1)]);

	//building.NewBuilding(30032, 30033, (rand() % 70) , rand()%(400) , rand() %(400), builTex[(rand()%4) +1], roofTex[(rand() % 4 + 1)]);

	//building.NewBuilding(30034, 30035, (rand() % 70) ,- rand()%(400) , rand() %(400), builTex[(rand()%4) +1], roofTex[(rand() % 4 + 1)]);

	//building.NewBuilding(30036, 30037, (rand() % 70) , -rand()%(400) , -rand() %(400), builTex[(rand()%4) +1], roofTex[(rand() % 4 + 1)]);

	//building.NewBuilding(30038, 30039, (rand() % 70) , -rand()%(400) , rand() %(400), builTex[(rand()%4) +1], roofTex[(rand() % 4 + 1)]);

	//-----------------------------------------------------
	//CHANGE MUSIC
	//dbStopMusic(m_title);
	//dbLoopMusic(m_idle);


	//LISA's models
	//dbLoadObject("MilitaryBase3DS.3DS",100);
	//dbLoadImage("military base texture version21.jpg", 1000);
	//dbScaleObject(100, 1000,1000,1000);
	//dbPositionObject(100, 100,0,100);
	//dbTextureObject(100,1000);

		//LISA's models ---TAKES TOO LONG TO LOAD
	//dbLoadObject("Dragon Unit 3DS.3DS",1000);
	//dbLoadImage("Dragon 5.jpg", 1000);
	//dbScaleObject(100, 1000,1000,1000);
	//dbPositionObject(100, 100,0,100);
	//dbTextureObject(100,1000);

	//	//LISA's models  ---TAKES TOO LONG TO LOAD
	//dbLoadObject("Gemstone Mine 3DS.3DS",102);
	//dbLoadImage("Gemstone Mine Texture 8.jpg", 1002);
	//dbScaleObject(102, 1000,1000,1000);
	//dbPositionObject(102, 100,0,-100);
	//dbTextureObject(102,1002);

		//LISA's models
	//dbLoadObject("Oil Derek.3DS",103);
	//dbLoadImage("oil rig texture version 3.jpg", 1003);
	//dbScaleObject(103, 2000,1000,1000);
	//dbPositionObject(103, 100,0,100);
	//dbTextureObject(103,1003);

	//	dbLoadObject("TownCenter3DS.3DS",104);
	//dbLoadImage("TownCenterTextureVersion21.jpg", 1004);
	//dbScaleObject(104, 1000,1000,1000);
	//dbPositionObject(104, 100,0,100);
	//dbTextureObject(104,1004);

	// turn on sync rate and set maximum rate to 60 fps
	dbSyncOn   ( );
	dbSyncRate ( 60 );
	
	Map map;
	map.newMap();


	//create bullets
	for (int xx=bullNumStart; xx< bullNumEnd; xx++) {
  
	  dbMakeObjectSphere(xx,1);
	  dbSetObjectLight(xx,0);
	  O[xx][L]=1;
  
	}

	dbAutoCamOff();
	
	//create selecter object
	dbMakeObjectSphere(1,5);
	
	//set up camera
	dbPositionCamera(50,100,50);
	dbPointCamera(50,0,100);

	//create planes
	planeEnv planeenv;
	//tour planes
	for (int xx=tourPlaneStart; xx< tourPlaneEnd; xx++) {
		planeenv.newTourPlane(xx);

	    O[xx][L]=1;
	  
	}
	
	//creata all vehicles, respective of their teams
	Vehicle veh;
	for (int x=100; x<103; x++) {
		if (player==gold) {
			veh.NewVehicle(gold, 34);
			
			//enemy
			//if (dbRND(1)==1) 
			veh.NewVehicle(red, 54);
			veh.NewVehicle(red,56);

			//building
			veh.NewVehicle(gold, 31);
			veh.NewVehicle(gold, 31);

			//enemy building
			veh.NewVehicle(red, 50);
			veh.NewVehicle(red, 50);
			veh.NewVehicle(red, 50);
			veh.NewVehicle(red, 50);
		}

		//debug problems
		//if (player==red) {
		//	veh.NewVehicle(red, 54);

		//	//enemy
		//	//if (dbRND(1)==1) 
		//	veh.NewVehicle(gold, 34);
		//	veh.NewVehicle(gold, 36);

		//	//building
		//	veh.NewVehicle(red, 50);
		//	veh.NewVehicle(red, 50);

		//	veh.NewVehicle(gold, 30);
		//	veh.NewVehicle(gold, 30);

		//	veh.NewVehicle(gold, 30);
		//	veh.NewVehicle(gold, 30);

		//}

	}






	//dbLoadObject("TOYSHOP.x",3);